//
//  LQRequestApi.h
//  BaseProject
//
//  Created by 喻飞 on 15/5/21.
//  Copyright (c) 2015年 yuf. All rights reserved.
//

#import <Foundation/Foundation.h>
#import  "MKNetworkEngine.h"
#import "CJSONDeserializer.h"
typedef enum
{
    F_F_getAdvertismentList         ,//广告
    F_F_userLogin                   ,//登录
    F_F_updatePassword              ,//修改密码
    F_F_articlesList                ,//扶贫快讯
    F_F_articlesDetail              ,//扶贫快讯详情
    F_F_poorAreaTown                ,//镇列表
    F_F_poorAreaCountry             ,//村列表
    F_F_farmerList                  ,//档案管理列表
    F_F_reportMessag                ,//驻村干部管理
    F_F_messageCollectionDetailes   ,//走访详情
    F_F_farmerDetail                ,//档案详情
    F_F_projectCount                ,//项目总计
    F_F_priceProjectCount           ,//资金总计
    F_F_projectCountDepartment      ,//按部门查询项目统计
    F_F_projectCountArea            ,//按地区查询项目统计
    F_F_projectCountImpleTime       ,//按年限查询项目统计
    F_F_priceProjectDepart          ,//按部门查询资金统计
    F_F_priceProjectArea            ,//按地区查询资金统计
    F_F_priceProjectImpleTime       ,//按年限查询资金统计
    F_F_projectType                 ,//查询项目分类
    F_F_projectList                 ,//查询扶贫项目列表
    F_F_projectDetail               ,//扶贫详情
    F_F_getProjectCountry           ,//扶贫项目 按脱贫村区分项目
    F_F_getProjectCountryTotal      ,//扶贫项目 总的贫困村项目统计
    F_F_priceProjectList            ,//扶贫资金管理条件查询项目列表
    F_F_getFarmerList               ,//查询某个村下面的贫困户
    F_F_messageCollection           ,//信息采集
    F_F_saveFarmerPosition          ,//提交贫困户信息
    F_F_getNearFarmerList            ,//地图
} LQRequestType;

#pragma  mark =============================================
@protocol LQRequestApiDelegate ;

@protocol LQRequestApiDelegate <NSObject>


@optional

//以数组的方式呈现
- (void)fetchDatabaseFinishedFromCache:(NSMutableDictionary*)database withTag:(NSInteger)tag;

- (void)fetchDatabaseFinished:(NSMutableDictionary*)database withTag:(NSInteger )tag;

- (void)fetchDatabaseFailed:(NSError *)error message:(NSString *)message;


@end

@interface LQRequestApi : NSObject

@property (nonatomic) BOOL isQueueRun;

@property (strong, nonatomic) NSMutableDictionary*  userInfo;   //传入的信息字典
@property (strong, nonatomic) NSDictionary*         dictionary; //返回的查询结果
@property (strong, nonatomic) NSError*              error;      //错误信息

@property (weak, nonatomic) id<LQRequestApiDelegate> delegate;

@property (strong, nonatomic) MKNetworkEngine         *  engine; //
@property (nonatomic ,strong) NSString *requestStatus;
@property (nonatomic ,strong) id dataReceiver;
@property   SEL finishSelector;
@property   SEL failSelSelector;


+(MKNetworkEngine *)shareEngine:(NSString *)hostName;
+(MKNetworkEngine *)shareEngine;
+(LQRequestApi *)sharedInstance;


/*   所有接口 调用此方法
 *   dic 传递参数
 *   interface_Path 接口地址
 *   type  POST  GET
 tag 标记
 */
-(void)requestOperationWithDic:(NSMutableDictionary  *)dic  withPath:(NSString *)interface_Path  withHttpType:(NSString *)type  withTag:(NSInteger )tag;
@end
